/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.kyiv.yellow.sociallibrary.reporting.data;

import java.util.Date;

/**
 *
 * @author NightmaresSeller
 */
public class BIReportBuilder implements IReportBuilder {

    public ReportNode buildReport() throws ReportBuildingException {
        // Create dummy report structure for test
        ReportNode root = new ReportNode("Book Info");
        ReportNode pageHeader = new ReportNode("PageHeader");
        ReportNode title = new ReportNode("Title");
        ReportNode biGrid = new ReportNode("BIGrid");
        ReportNode bi = new ReportNode("BIGridRow");
        pageHeader.setAttribute("datetime", new Date());
        pageHeader.setAttribute("generationtime", new Integer(100));
        title.setAttribute("text", "Books Info");
        bi.setAttribute("isbn", new Integer(1450562795));
        bi.setAttribute("title", "Shadow Over Innsmouth");
        bi.setAttribute("author", "Lovecraft H. P.");
        bi.setAttribute("genre", "Fiction");
        bi.setAttribute("pages", new Integer(108));
        bi.setAttribute("rating", new Integer(5));
        bi.setAttribute("pubdate", new Date());
        bi.setAttribute("publisher", "NightmaresSeller");
        root.addChild(pageHeader);
        root.addChild(title);
        root.addChild(biGrid);
        biGrid.addChild(bi);
        return root;
    }
    
}
